Pirate Coves (1.4.3)
============
by lazygun
(Converted to JS by Eric Walch)

Hidden in the asteroid belt, something lurks

>Pirate n. One who robs at sea or plunders the land from the sea without commission from a sovereign nation.
>Cove n. A small sheltered bay in the shoreline of a sea, river, or lake.

Oolite is a wonderful retro space-combat game that runs on Mac OS X. I downloaded it, played it  (ah, the nostalgia...) and loved the new innovations, such as seeing a fight in the distance and choosing to interfere. 

As I played, I started thinking: where do the pirates sell their booty and replenish their ships? It ought to be dangerous for them to visit the system's main space station. In fact, version 1.38 of the game introduces  police viper patrols around the station.

So the pirates need somewhere to hang out. Well, we already have alternative places to dock: rock hermits.  Some tinkering, some modification of the program (aegidean was very co-operative) and pirate-coves.oxp is the result.

### Installation ###

Download pirate_coves_oxp.zip and extract its contents. Drag pirate_coves.oxp to your Oolite/AddOns folder.

### What it does ###

It's very simple. It turns 20% of rock hermits into be pirate bases. They look just like a rock hermit, and are reported by your identification system as such. There's absolutely no way to tell the difference, until the base launches a group of pirate ships to attack you! 

It also adds a few extra pirate coves. First, there's a guaranteed pirate cove at Diso, so you can very quickly start a new game and see a cove in action. It's also a very good way for a new pilot to die! Second, if there's enough pirate activity in a system, a pirate cove gets added. It's a bit of a reversal of cause and effect, but the result is there are lots of pirates in systems with pirate coves.

### Oolite versions ###
- It works with all Oolite versions from 1.75 onwards. 

### Bugs ###

No bugs known. However, some oxp's include hermits without rock scanclass. Those are painted white by this oxp but will have a 'clean' label on them.

### Update ###
01-06-2026 Update to version 2.1
- Moved all text to descriptions.plist for easier localisation.

28-07-2025 Update to version 2.0.2
- Ensured pirate coves don't replace Hermitages.

30-03-2023 Update to version 2.0.1
- Fixed JS error when arriving in Diso.

01-03-2024 Update to version 2.0
- Reworked populator script to allow the game to be saved at Pirate Coves.
- Moved the location of Pirate Coves to be a little bit away from the main space lane.
- Made all the spawning rules for Pirate Coves configurable via Library Config, including:
    . Whether single Pirate Coves should be spawned at all
    . Whether to include a sample Pirate Cove at Diso (G1)
    . Controlling how close to the space lanes a single Pirate Cove should be spawned.
    . Whether Pirate Coves should replace standard Rock Hermits, in any of their 3 varieties (neutral, chaotic or pirate), and what the chance of the replacement should be

12-5-2013 Update to version 1.4.1
- Minor improvements on the test release.

xxxxxxx Update to version 1.4.0 (only test releases)
- Pirate Coves are now always mostly at the same position. There will be variation after long periods.
- Killed pirate coves will not be rebuild within a certain time (about 20 days).


23-4-2012 Update to version 1.3.3
- Minor fix to prevent a harmless error logging in Oolite versions after 1.76.

13-8-2011 Update to version 1.3.2
- Launching escorts now have a bounty also.

2-8-2011 Update to version 1.3.1
- Rotating hermits can have random trader launches by default. Fixed this by setting npcTraffic to 'false' for all pirate coves.

17-7-2011 Updated to version 1.3.
- Raised minimum Oolite to 1.74. 
- The pirate cove no longer uses Oolites standard hermit model, but selects a random rock-hermit from the installed ships and turns it into a pirate cove. However, some hermits will still use the default hermits.
- Amount of defenders is randomised and also made dependent on the player score.

8-1-11 Updated to version 1.2.2.
- Fixed some case bugs that will trigger errors after Oolite 1.74.

30-8-09 Updated to version 1.2.1.
- Raised minimum Oolite to 1.72

28-6-09 Updated to version 1.2. 
- Adapted for Oolite 1.73. (Will still work with 1.72) 
- When used with Oolite 1.73 or higher the launching pirates use a custom script that makes them act better as group.
- With 1.73 pirates defenders will fly to the nearest station after a fight when out of scanner range of a their mother station. (In most case the nearest will be the pirate cove).
- With 1.72 or earlier pirates would just start lurking for victims like normal pirates.

3-1-2008 updated to version 1.1.
- The original version (no version nr) contained a bug in the AI that made it never launched pirates by itself after it detected a piece of floating debris.
- The previously mentioned bug about returning defenders crashing while docking is not seen anymore. But docking was part of Oolite's internal docking routine and is probably fixed loooong ago.
- Added a JS script with a more variable addition of the cove along the spacelane.
- Lowered the 50% hermit replacement to 20%.